package b1.conifg
{
	import b1.conifg.story.*;
	
	public class SpecialCaseConfig
	{
		//特殊案件的唯一索引
		public var index:int;
		//对应的任务类型
		public var taskType:int;
		//对应的任务号
		public var taskId:int;
		//案件名称
		public var name:String;
		//案件副标题
		public var subName:String;
		//和animal的id对应
		public var bossId:int;
		//和player的id对应
		public var bossOwnerId:int;
		//案件描述
		public var description:String;
		//案件的背景图片
		public var backgroundImageInDetectDialog:String;
		//案件的图标
		public var iconImageInDetectDialog:String;
		//助手的话（单击探案对话框中的案件之后）
		public var helperMessage:String;
		//加上嫌疑犯(没加完)
		public var suspectAnimals:Array;
		//审讯室boss的动作
		public var bossMcTypeInSuspect:int;
		//审讯室boss的扔的武器图片
		public var objectImgBossThrow:String;
		//探案界面结束时，对话框的文字
		public var wordsEndSuspect:String;
		//故事步骤
		public var steps:Array;
		
		public function SpecialCaseConfig(specialCaseXML:XML)
		{
			index = parseInt(specialCaseXML.index);
			taskType = parseInt(specialCaseXML.taskType);
			taskId = parseInt(specialCaseXML.taskId);
			name = specialCaseXML.name;
			subName = specialCaseXML.subName;
			bossId = parseInt(specialCaseXML.bossId);
			bossOwnerId = parseInt(specialCaseXML.bossOwnerId);
			description = specialCaseXML.description;
			backgroundImageInDetectDialog = specialCaseXML.backgroundImageInDetectDialog;
			iconImageInDetectDialog = specialCaseXML.iconImageInDetectDialog;
			helperMessage = specialCaseXML.helperMessage;
			bossMcTypeInSuspect = parseInt(specialCaseXML.bossMcTypeInSuspect);
			objectImgBossThrow = specialCaseXML.objectImgBossThrow;
			wordsEndSuspect = specialCaseXML.wordsEndSuspect;
//			specialCaseClues = new Array();
//			//boss的线索
//			for (var i:int = 0; i < specialCaseXML.clue.length(); i++)
//			{
//				var caseClue:ClueInfo = new ClueInfo();
//				caseClue.clueIndex = specialCaseXML.clue[i].clueIndex;
//				caseClue.clueValue = specialCaseXML.clue[i].clueValue;
//				specialCaseClues.push(caseClue);
//			}
			//嫌疑犯
			suspectAnimals = new Array();
			for (var j:int = 0; j < specialCaseXML.suspectAnimal.length(); j++)
			{
				suspectAnimals.push(specialCaseXML.suspectAnimal[j].animalId);
			}
			//fight场景信息
//			fightInfo = new FightInfo(specialCaseXML.fightInfo[0]);
			//故事步骤
			steps = new Array;
			for (var i:int = 0; i < specialCaseXML.step.length(); i++)
			{
				var stepXML:XML = specialCaseXML.step[i];
				var type:int = parseInt(stepXML.type);
				var step:StepConfig;
				switch (type)
				{
					case 0:
						step = new SpeakConfig(stepXML);
						break;
					case 1:
						step = new ArrowHelperConfig(stepXML);
						break;
					case 2:
						step = new FightConfig(stepXML);
						break;
					case 3:
						step = new ControlConfig(stepXML);
						break;
					case 4:
						step = new SwitchHomeConfig(stepXML);
						break;
					case 5:
						step = new AccomplishTaskConfig(stepXML);
						break;
					case 6:
						step = new AnimalMoveConfig(stepXML);
						break;
					case 7:
						step = new ArrestConfig(stepXML);
						break;
					case 8:
						step = new PlayMovieClipConfig(stepXML);
						break;
					case 9:
						step = new TowerConfig(stepXML);
						break;
					default:
						step = new StepConfig(stepXML);
				}
				steps.push(step);
			}
		}

	}
}



